#include"EffectManager.h"

/////////////////
//include
/////////////////
#include"ContentManager.h"
/////////////////
//prottype
/////////////////

/////////////////
//const
/////////////////


EffectManager::EffectManager(int max_effect_num,Camera* camera,SpriteDrawer* sd) :  Manager<Effect>(max_effect_num)
{
	this->camera = camera;
	this->sd = sd;
	anims = Array<Animation*>(max_effect_num);
	tex_index = 0;
	this->max_effect_num = max_effect_num;
}
EffectManager::~EffectManager()
{

}

void EffectManager::Init()
{

}
void EffectManager::ContentLoad(Device* device)
{

}
void EffectManager::UpdateFunc(Effect* type) 
{
	
}
void EffectManager:: DrawFunc(DeviceContext* device_context, Effect* type) 
{
	type->Draw(camera,sd);
}
void EffectManager::SetFunc(Effect* object,int model_index)
{
	object->SetAnimation(anims[model_index]);
}
bool EffectManager::DeleteFunc(Effect* object)
{
	return object->IsEnd();
}
void EffectManager::SetAnimation(std::string name,float width,float height)
{
	if(max_effect_num <= tex_index)
	{
		return;
	}
	anims[tex_index] = ContentManager::LoadAnime(name,width,height);
	tex_index++;
	
}